<?php

use Doctrine\Common\ClassLoader,
    Doctrine\Common\Cache\ArrayCache,
    Doctrine\ORM\Configuration,
    Doctrine\ORM\EntityManager,
    Doctrine\Common\Cache\ApcCache,
    Entities\User, Entities\Address;
    
class Welcome extends Controller {

	function Welcome()
	{
		parent::Controller();
		$config = new Configuration();
        $config->setMetadataCacheImpl(new ArrayCache);
        $config->setProxyDir(APPPATH . '/proxies');
        $config->setProxyNamespace('Proxies');
        
        $connectionOptions = array(
            'driver' => 'pdo_sqlite',
            'path' => BASEPATH."database.sqlite"
        );
		$this->em = getEntityManager($connectionOptions, $config);
	}
	
	function index()
	{
        $user = new User;
        $user->setName('George');
        $this->em->persist($user);
        $this->em->flush();
		$this->load->view('welcome_message');
	}
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */